package zld369504.tw.m_team;

import android.content.Context;
import android.content.SharedPreferences;

public class MySharedPreference {

    private static MySharedPreference instance;
    private final String SP_NAME = "sp_m_team";

    public static MySharedPreference getInstance() {
        if (instance == null) {
            instance = new MySharedPreference();
        }
        return instance;
    }

    private MySharedPreference() {

    }

    public void markCopyTorrentLinkHintRead(Context context,boolean state) {
        SharedPreferences settings = context.getSharedPreferences(SP_NAME, Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = settings.edit();
        editor.putBoolean("read_copy_link_risk_hint",state);
        editor.apply();
    }

    public boolean getCopyTorrentLinkHintReadState(Context context){
        SharedPreferences settings = context.getSharedPreferences(SP_NAME, Context.MODE_PRIVATE);
        return settings.getBoolean("read_copy_link_risk_hint",false);
    }
}
